﻿using STHPMS1.DAL.D_Core;
using STHPMS1.ICore.I_DAL.Repository;
using System.Data;
using System.Data.SqlClient;

namespace STHPMS1.DAL.D_Repository
{
    public class Dr_InitialconstructioncostRepository : DalBase, IDr_InitialconstructioncostRepository
    {

        public DataTable GetComparePlan(string proj_Id)
        {
            string sql=string.Format(@"select l.INIPROJ_ID,l.MEAS_NAME FROM DR_INITIALCONSTRUCTION i
	JOIN DR_LARGEMEAS_INI l
	on i.INIPROJ_ID=l.INIPROJ_ID
    where i.PROJ_ID='{0}'
    ORDER BY INIPROJ_ID ;", proj_Id);

          return Adapter.DataAdapter.FillDataTable(sql);
        }

        public DataTable GetIniCost(string proj_Id)
        {
            string sql = string.Format(@"SELECT l.INIPROJ_ID, l.STRU_ID,l.MATER_THICK,i.AMOUNT,i.INICONS_COST from DR_INI_LAYMATE l 
	join DR_INITIALCONSTRUCTION i
	on l.INIPROJ_ID=i.INIPROJ_ID
    WHERE i.PROJ_ID='{0}';", proj_Id);

            return Adapter.DataAdapter.FillDataTable(sql);
        }
    }
}
